package com.kgc.storeconsumer.controller;

import com.kgc.basic.util.ResponseMsg;
import com.kgc.store.pojo.InventoryCheckDetail;
import com.kgc.store.pojo.OutStore;
import com.kgc.storeconsumer.feign.InventoryCheckDetailFeign;
import com.kgc.storeconsumer.feign.InventoryCheckFeign;
import com.kgc.storeconsumer.feign.OutStoreFeign;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.Map;

@Controller
@CrossOrigin("*")
@RequestMapping("/inventoryCheckDetail")
public class InventoryCheckDetailController {
    private Logger logger = LoggerFactory.getLogger(getClass());
    @Autowired
    private InventoryCheckDetailFeign inventoryCheckDetailFeign;

    @RequestMapping("getInventoryCheckDetailList")
    @ResponseBody
    public ResponseMsg getInventoryCheckDetailList(String inventoryCheckCode){
        logger.info("InventoryCheckDetailController getInventoryCheckDetailList inventoryCheckCode:"+inventoryCheckCode);
        ResponseMsg msg =inventoryCheckDetailFeign.getInventoryCheckDetailList(inventoryCheckCode);
        logger.debug("InventoryCheckDetailController getInventoryCheckDetailList msg:"+msg);
        return msg;
    }

    @RequestMapping("delInventoryCheckDetail")
    @ResponseBody
    public ResponseMsg delInventoryCheckDetail(String inventoryCheckCode){
        logger.info("InventoryCheckDetailController delInventoryCheckDetail inventoryCheckCode:"+inventoryCheckCode);
        ResponseMsg msg =inventoryCheckDetailFeign.delInventoryCheckDetail(inventoryCheckCode);
        logger.debug("InventoryCheckDetailController delInventoryCheckDetail msg:"+msg);
        return msg;
    }

    @RequestMapping("insertInventoryCheckDetail")
    @ResponseBody
    ResponseMsg insertInventoryCheckDetail(@RequestBody InventoryCheckDetail inventoryCheckDetail){
        logger.info("InventoryCheckDetailController insertInventoryCheckDetail inventoryCheckDetail:"+inventoryCheckDetail);
        ResponseMsg msg = inventoryCheckDetailFeign.insertInventoryCheckDetail(inventoryCheckDetail);
        logger.debug("InventoryCheckDetailController insertInventoryCheckDetail msg:"+msg);
        return msg;
    }
}
